Skip to content

cuda.core: expose last prefetch location on ManagedBuffer - #2774

Merged
isVoid merged 5 commits into
NVIDIA:mainfrom
isVoid:fea-2109
Sep 11, 2026
Merged

cuda.core: expose last prefetch location on ManagedBuffer#2774
isVoid merged 5 commits into
NVIDIA:mainfrom
isVoid:fea-2109

Conversation

@isVoid

@isVoid isVoid commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

closes #2109

Expose the read-only ManagedBuffer.last_prefetch_location property.

  • Map the legacy CUDA 12 range attribute to Device, Host, or None.
  • Query the CUDA 13 LAST_PREFETCH_LOCATION_TYPE / _ID pair so NUMA host locations round-trip.
  • Replace test-only private range-attribute probes with the public property.
  • Update API documentation and generated Cython stubs.

Testing

  • cd cuda_core && pixi run -e cu13 pytest tests/memory/test_managed_ops.py -q — 37 passed, 1 skipped
  • cd cuda_core && pixi run -e cu12 pytest tests/memory/test_managed_ops.py -q — 16 passed, 22 skipped
  • Changed-file pre-commit hook suite — passed

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Sep 5, 2026
@isVoid
isVoid marked this pull request as ready for review September 8, 2026 17:49
@isVoid

isVoid commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test

@copy-pr-bot

copy-pr-bot Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

/ok to test

@isVoid, there was an error processing your request: E1

See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/

@isVoid

isVoid commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 08b4cf4

@isVoid isVoid self-assigned this Sep 8, 2026
@isVoid isVoid added the feature New feature or request label Sep 8, 2026
@isVoid isVoid added this to the cuda.bindings 13.5.0 & 12.9.10 milestone Sep 8, 2026
from cuda.core._utils.version import binding_version, driver_version

if binding_version() < (13, 0, 0) or driver_version() < (13, 0, 0):
pytest.skip("Host NUMA last-prefetch location requires CUDA 13")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been trained to lean towards skipping at collection time. Worth doing here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if there are any order requirement at test collecting time and initializing CUDA. Let me check with my agent to see if possible.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brandon-b-miller brandon-b-miller left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good. Based on what happened when this features sibling attrs were introduced, I infer that we may need a release notes entry documenting this new feature.

Comment thread cuda_core/cuda/core/_memory/_managed_memory_ops.pyx Outdated
@isVoid

isVoid commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test afb0334

@isVoid

isVoid commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bcf63da

@github-actions

This comment has been minimized.

@isVoid
isVoid merged commit 68480f6 into NVIDIA:main Sep 11, 2026
309 of 314 checks passed
@github-actions

Copy link
Copy Markdown
Contributor
Doc Preview CI
Preview removed because the pull request was closed or merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cuda.core: expose mem-range attributes on ManagedBuffer (last_prefetch_location and read-side getters)

2 participants